package com.xiaocikuai.smallchunks.mapper.Advertise;

import com.xiaocikuai.smallchunks.entity.Advertise.Advertise;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

public interface AdvertiseMapper {
    @Insert("INSERT INTO ad_system (theme, image, url, time, platform) VALUES (#{advertise.theme}, #{advertise.image}, #{advertise.url}, #{advertise.time}, #{advertise.platform})")
    void add(Advertise advertise);

    @Delete("DELETE FROM ad_system WHERE id = #{advertise.id}")
    void delete(Advertise advertise);

    @Update("UPDATE ad_system SET theme = #{advertise.theme}, image = #{advertise.image}, url = #{advertise.url}, time = #{advertise.time}, platform = #{advertise.platform} WHERE id = #{advertise.id}")
    void update(Advertise advertise);
}
